package com.user.test.model.database

import androidx.lifecycle.LiveData
import androidx.room.*
import io.reactivex.Completable

@Dao
interface SearchResultDao {
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun insert(searchResult : SearchResult) : Completable

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun insertAll( searchResult: List<SearchResult>)

    @Update
    fun update(searchResult: SearchResult)

    @Delete
    fun delete(searchResult: SearchResult)

    @Query("SELECT * FROM search_db")
    fun getAll(): LiveData<List<SearchResult>>
}